#pragma once

#include "Base/ThreadMessage.h"
#include "Net/Socket.h"
#include "Base/IOFifo.h"

#define DEFINE_THREAD_MSG_BEGIN(_classname, _id) \
class _classname : public CThreadMessage \
{ \
public: \
enum \
{ \
	ID = _id, \
}; \
	_classname() { setMessageID(_id); } \
	virtual ~_classname() {} \
public:

#define DEFINE_THREAD_MSG_END \
};



DEFINE_THREAD_MSG_BEGIN(CMessageAddSocket, 0)
	int mSocketFD;
	char mSocketAddr[IP_LENGTH];
DEFINE_THREAD_MSG_END

DEFINE_THREAD_MSG_BEGIN(CMessageAddNetEntity, 1)
	int mSocketFD;
	CNetEntity *mNetEntity;
DEFINE_THREAD_MSG_END

class CPacket;
DEFINE_THREAD_MSG_BEGIN(CMessageAddLogicSendFifo, 2)
	CIOFifo<CPacket*> *mFifo;
DEFINE_THREAD_MSG_END

class CNetEntity;
class CLogicEntity;
DEFINE_THREAD_MSG_BEGIN(CMessageNetEntityEnter, 3)
CNetEntity *mNetEntity;
CLogicEntity *mLogicEntity;
DEFINE_THREAD_MSG_END